
/**    
 * <p>Copyright： 东软烟草产品研发团队</p>   
 */

package com.jkl.service.param;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageInfo;
import com.jkl.dao.param.BSParamMapper;
import com.jkl.entity.param.BSParam;
import com.jkl.service.param.inter.IBSParamService;

import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.entity.Example;

/**
 * <p>
 * 123service
 * <p>
 * <p>
 * 123service
 * <p>
 * <p>
 * 变更说明：ji.k 2018年1月17日 123service
 * <p>
 * Date:2018年10月03日
 * 
 * @author ji.k
 * @version 1.0
 */
@Service
@Slf4j
public class BSParamService implements IBSParamService {

	@Autowired
	private BSParamMapper bSParamMapper;

	@Override
	public BSParamMapper getMapper() {
		// TODO Auto-generated method stub
		return bSParamMapper;
	}

	public List<BSParam> queryParamByGroupCode(BSParam param) {
		Example example = new Example(BSParam.class);
		example.createCriteria().andEqualTo("groupCode", param.getGroupCode());
		return bSParamMapper.selectByExample(example);
	}

	@Override
	public List<BSParam> queryParamGroupList() {
		return bSParamMapper.queryParamGroupList();
	}

	@Override
	public List<BSParam> queryParamByEntity(BSParam param) {
		return bSParamMapper.queryParamByEntity(param);
	}

	@Override
	public BSParam queryNextCodeByGroup(BSParam param) {
		return bSParamMapper.queryNextCodeByGroup(param);
	}

	@Override
	public boolean deleteParam(BSParam param) {
		int result = 0;
		result = bSParamMapper.updateByPrimaryKeySelective(param);
		return result > 0;
	}

	@Override
	public int addParam(BSParam param) {
		return bSParamMapper.addParam(param);
	}

	@Override
	public BSParam queryCode(BSParam bSParam) {
		BSParam list = bSParamMapper.queryCode(bSParam);
		return list;
	}

	@Override
	public PageInfo<BSParam> queryInit(String groupCode) {
		List<BSParam> list = bSParamMapper.queryInit(groupCode);
		PageInfo<BSParam> pageInfo = new PageInfo<>(list);
		return pageInfo;
	}

}